Component({
  /**
   * 组件的属性列表
   */
  properties: {
    inputHint: {//占位符
      type: String,
      value: ''
    },
    inputIcon: {//左侧图标
      type: String,
      value: ''
    },
    inputType: {//键盘类型
      type: String,
      value: 'text'
    },
    isPassword: {//密码密文
      type: Boolean,
      value: false
    },
    confirmType: {//完成键类型
      type: String,
      value: "done"
    },
    maxLength: {//最大长度
      type: String,
      value: '100'
    },
    clear_show: {//
      type: Boolean,
      value: true
    },
    icon2_show: {//密码密文
      type: Boolean,
      value: true
    },

    Password_show: {//密码密文
      type: Boolean,
      value: false
    },
  },


  /**
   * 组件的初始数据
   */
  data: {
    isClearShow: false,//显示清除按钮
    inputValue: '',
    show_icon: "https://logisticsengineering.gree.com/img/password_false_2.png"
  },

  /**
   * 组件的方法列表
   */
  methods: {
    //输入监听
    inputListener: function (e) {
      var value = e.detail.value;
      var detail = {
        value: value,
      };
      this.setData({
        inputValue: value
      })
      this.triggerEvent('inputListener', detail);
    },
    //点击完成按钮
    inputConfirm: function (e) {
      var value = e.detail.value;
      var detail = {
        value: value
      }
      this.triggerEvent('inputConfirm', detail);
    },
    // 切换密码可见 
    showPassword() {
      console.log(this.data.Password_show);
      if (this.data.Password_show == false) {
        this.setData({
          Password_show: true,
          show_icon: "https://logisticsengineering.gree.com/img/password_true_2.png"
        })
      } else {
        this.setData({
          Password_show: false,
          show_icon: "https://logisticsengineering.gree.com/img/password_false_2.png"
        })
      }



    }

  }
})
